<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php

    $dsn = 'mysql:dbname=unidu_rezervacija;host=localhost;port=3306;charset=utf8';
    try {
      $dbh = new PDO($dsn, 'root', '');
    }
    catch (PDOException $e) {
      die('Konekcija neuspješna: ' . $e->getMessage(  ));
    }
 
if (true) {   
    $upit='CALL unidu_rezervacija.dohvati_aktivna_vozila';
    $sth = $dbh->query($upit);
    if ($dbh->errorCode() <> '00000') {
      die("Error: ".implode(': ',$dbh->errorInfo(  ))."\n");
    }
    
    while ($row=$sth->fetch(  )) {
      printf("%d %s %s %s <br />",$row['VOZILO_ID'],$row['OPIS'],$row['STATUS'],$row['BILJESKE']);
    }
    
}

?>
</body>
</html>